package com.zwc.factory;

public class TuXingFactory {

    public static TuXing creatTuXing(String choose,Integer num){
        TuXing tuxing = null;
        if (choose.equals("YuanXing")){
            tuxing = new YuanXing(num);
        }else if(choose.equals("ZhengFangXing")){
            tuxing = new ZhengFangXing(num);
        }
        return tuxing;
    }

    public static void main(String[] args) {
        Integer rueult = creatTuXing("ZhengFangXing", 2).calculate();
        System.out.println(rueult);
    }
}
